import useTableHeight from '@/hooks/useTableHeight';

export default () => {
    const ganttBodyRef = ref<HTMLDivElement>();

    const windowH = window.innerHeight;
    const ganttBounding = useElementBounding(ganttBodyRef);

    const height = ref('0px');

    const handleHeight = () => {
        const ganttH = windowH - ganttBounding.top.value - 36 - 35;

        height.value = ganttH + 'px';
    };

    useTableHeight(handleHeight, undefined, ganttBodyRef);

    return {
        ganttBodyRef,
        height
    };
};
